import type { IResCategory } from '@/types/category'
import { http } from '@/utils/request'
/**
 * @description 获取一级类别数据
 */
export const reqCategory = () => {
  return http<IResCategory[]>('/admin/product/getCategory1', 'GET')
}

/**
 * @description 获取二级类别数据
 * @param id 类别一的数据id
 */
export const reqCategory1 = (id: number) => {
  return http<IResCategory[]>(`/admin/product/getCategory2/${id}`, 'GET')
}

/**
 * @description 获取三级类别数据
 * @param id 类别二数据id
 */
export const reqCategory2 = (id: number) => {
  return http<IResCategory[]>(`/admin/product/getCategory3/${id}`, 'GET')
}
